package org.ym.file.domain.model.node.embed;

import lombok.*;
import org.ym.file.domain.model.node.enums.NodeInfoType;
import org.ym.file.domain.model.node.enums.NodeInfoTypeConverter;

import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Embeddable;
import java.io.Serializable;

/**
 * @author ym
 */
@Embeddable
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Builder
@EqualsAndHashCode
@ToString
public class NodeInfo implements Serializable {

    private static final long serialVersionUID = 7852821018632788449L;
    /**
     * 文件系统ip
     */
    @Column(name = "node_ip",length = 64)
    private String nodeIp;
    /**
     * 文件系统端口
     */
    @Column(name = "node_port")
    private Integer nodePort;
    /**
     * 节点类型
     */
    @Column(name = "node_info_type",nullable = false)
    @Convert(converter = NodeInfoTypeConverter.class)
    private NodeInfoType nodeInfoType;
}
